/*
 * @Author: hcluo
 * @Date: 2020-08-29 10:04:24
 * @LastEditors: hcluo
 * @LastEditTime: 2020-08-29 19:53:39
 * @Description:
 */
import React from 'react';
// import PropTypes from 'prop-types';
import { Button, Upload, message } from '@wind/wind-ui';
export default function RightTool() {
  const props = {
    name: 'file',
    action: '//jsonplaceholder.typicode.com/posts/',
    headers: {
      authorization: 'authorization-text',
    },
    showUploadList: false,
    onChange(info) {
      if (info.file.status !== 'uploading') {
        console.log(info.file, info.fileList);
      }
      if (info.file.status === 'done') {
        message.success(`${info.file.name} file uploaded successfully`);
      } else if (info.file.status === 'error') {
        message.error(`${info.file.name} file upload failed.`);
      }
    },
  };
  return (
    <div className="common-right-tool">
      <Upload {...props}>
        <Button
          onClick={() => {
            window.RightFunction(4);
          }}
        >
          导入成分
        </Button>
      </Upload>
      <Button
        onClick={() => {
          window.RightFunction(5);
        }}
      >
        导出成分
      </Button>
      <Button
        onClick={() => {
          window.RightFunction(1);
        }}
      >
        删除品种
      </Button>
      <Button
        onClick={() => {
          window.RightFunction(2);
        }}
      >
        清空板块
      </Button>
      <Button
        onClick={() => {
          window.RightFunction(3);
        }}
      >
        反向选择
      </Button>
    </div>
  );
}

RightTool.propTypes = {};
RightTool.defaultProps = {};
